﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using IDotNet.MapLibs;
using IDotNet.MapLibs.BingMap.Model;
using IDotNet.MapLibs.Model;
using Xunit;

namespace TestConsole
{
    public class GeocodingFact : BaseFact
    {

        [Fact]
        public void GeocoderBMap()
        {
            var result = GeocodingFactory.GetGeocoding(MapType.BMap).Geocoder(new BMapGeocoderRequestModel()
            {
                address = "深圳坂田市场",
                city = "深圳",
            });
            Assert.True(result.IsSuccess(), result.Msg);
        }

        [Fact]
        public void GeocoderBingMap()
        {
            var result = GeocodingFactory.GetGeocoding(MapType.BingMap).Geocoder(new BingMapGeocoderRequestModel()
            {
                address = "深圳坂田市场",
                city = "深圳",
            });
            Assert.True(result.IsSuccess(), result.Msg);
        }


        [Fact]
        public void GeocoderLocationBMap()
        {
            var result = GeocodingFactory.GetGeocoding(MapType.BMap).GeocoderLocation(new BMapGeocoderLocationRequestModel()
            {
                location = new PointModel()
                {
                    lng = 114.0711,
                    lat = 22.644569
                },
            });
            Assert.True(result.IsSuccess(), result.Msg);
        }
    }
}
